package cn.wolfcode.trip.base.domain;

import com.alibaba.druid.support.json.JSONUtils;
import lombok.Getter;
import lombok.Setter;

import java.util.HashMap;

@Setter
@Getter
public class Region extends BaseDomain{
    public static final Integer STATE_NORMAL = 0;//普通状态
    public static final Integer STATE_HOT = 1;//推荐状态


    private String name; //地区名称

    private Long parentId; //关系ID

    private Integer state = STATE_NORMAL;//默认普通状态

    //返回Json字符串
    public String getJsonString()  {
        HashMap<String, Object> map = new HashMap<>();
        map.put("id",id );
        map.put("name", name);
        map.put("parentId",parentId );
        map.put("state", state);
        return JSONUtils.toJSONString(map);
    }

}